<%--
    Document   : login
    Created on : Feb 24, 2011, 3:15:32 PM
    Author     : Admin
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
<%@ taglib prefix="sjr" uri="/struts-jquery-richtext-tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<script type="text/javascript">
    var JOIN_EVENT_URL = "<s:url value="/ajax/joinEvent"/>";
    var WRITE_COMMENT_URL = "<s:url value="/ajax/writeEventComment"/>";
</script>
<div class="news-filter">
    <h2>
        <a title="Đăng ký nhận tin hot qua RSS" href="/tin-hot/rss/"><img height="16" width="16" alt="rss" src="http://www.linkhay.com/templates/images/icons/rss.png" class="rss"></a>
        <a title="Địa điểm" href="/tin-hot" class="active">Thời gian</a> | <a title="Địa điểm" href="/tin-moi">Địa điểm</a>
    </h2>

</div>
<div id="event_stream">
    <ul class="list_event">
        <li id="event-1">
            <div class="event-items clearfix">
                <div class="event-thumb right">
                    <img src="http://pds.mnet.com/EventImg/images/2011310151541.jpg" alt=""/>
                </div>
                <div class="event-short-details">
                    <div class="event-item-content">
                        <h2><s:property value="event.eventName"/>
                            <sec:authorize ifAllGranted="ROLE_USER">
                                <s:if test="event.eventId not in #session['EVENT_REQUEST_LIST']">
                                    <span id="btnJoinEvent" class="right" style="margin-left: 10px; margin-top: 5px; position: absolute;">
                                        <a class="btn" href="javascript://" onclick="joinEvent(<s:property value="event.eventId"/>)">Tham gia</a>
                                    </span>
                                </s:if>
                                <s:else>
                                    <span>Bạn đang xin gia nhập.</span
                                </s:else>
                            </sec:authorize>
                        </h2>
                            <br/>
                    </div>
                    <div class="event-author">
                        Bắt đầu lúc: <a class="screen-name" href="#"><s:date name="event.startDate" format="dd-MMM-yyyy 'at' hh:mm a" nice="true" /> </a>
                    </div>
                    <div class="event-author">
                        Kết thúc lúc:
                        <span class="datetime">
                            <s:date name="event.endDate" format="dd-MMM-yyyy 'at' hh:mm a" nice="true" />
                        </span>
                    </div>

                    </span>
                    <div class="event-detail">
                        Giới thiệu: <s:property value="event.shortDetail"/>
                    </div>

                </div>
            </div>
        </li>
    </ul>
</div>
<div class="event-description">
    <h2>Event Description</h2>
    <div>
        <span class="description">
            <s:property value="event.eventDetail" escape="false"/>
        </span>
    </div>
</div>
<div class="event-description">
    <h2>Discussion</h2>

    <textarea rows="1" style="width: 99%; margin-top: 10px;" onfocus="switchComment()" class="textarea_comment" placeholder="Write comment..."></textarea>
    <span class="right hide" id="btn_comment" style="margin-top: 5px;">
        <input type="submit" value="Bình luận" class="btn">
    </span>
</div>


<s:iterator value="topicList">
    <div style="display: table-row;" id="Topic<s:property value="topicId"/>">
         <div class="topic-discussion">
            <div class="topic">
                <table width="100%">
                    <tbody>
                        <tr>
                            <td width="30" height="30" valign="top">
                                <img src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/187548_1299602386_5479905_q.jpg"/>
                            </td>
                            <td valign="top" style="padding-left: 10px;">
                                <span class="username clearfix">
                                    <a href="#"><s:property value="account.familyName +' '+ account.givenName" default="GUEST"/></a>
                                </span>
                                <span class="clearfix">
                                    <s:property value="topicTitle"/>
                                </span>
                                <span class="datetime clearfix">
                                    <s:date name="topicTime" format="dd-MMM-yyyy 'at' hh:mm a"/> <a href="javascript://">Comment</a>
                                </span>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <s:if test="%{(posts != null) && (posts.size()>0)}">
            <div class="post">
                <ul>
                    <s:iterator value="posts">
                        <li class="box_comment" id="box_comment<s:property value="postId"/>">
                        <div class="post_content" class="Post">
                            <a href="" style="float:left; width: 50px;">
                                <img src="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/187805_300630757860_1494501_q.jpg"/>
                            </a>
                            <div style="padding-left: 5px; float: right; display: inline; position: absolute;">
                                <a style="font-weight: bold;" href="#" title="jahsgdas"><s:property value="account.familyName +' '+ account.givenName" default="Van Nguyen"/></a>
                                <span class="text_comment"><s:property value="postContent"/>.</span>
                                <span class="datetime clearfix">
                                    <s:date name="postTime" format="dd-MMM-yyyy 'at' hh:mm a"/>
                                </span>
                            </div>
                        </div>
                    </li>
                    </s:iterator>
                    <li class="box_comment" id="box<s:property value="topicId"/>">
                            <textarea rows="1" style="width: 99%;" class="textarea_comment" onfocus="switchComment(<s:property value="topicId"/>)" placeholder="Write comment..."></textarea>
                            <span class="right hide" id="btn_comment_<s:property value="topicId"/>" style="margin-top: 5px;">
                                <input type="submit" value="Bình luận" class="btn" onclick="writeEventComment(<s:property value="topicId"/>)">
                            </span>
                    </li>
                </ul>
            </div>
         </s:if>
     </div>
 </s:iterator>
                        
                    
                    